<script>

    const age = 12
    const name = "Amy"

    // 传统方式
    const p1 = {name:name,age:age}
    console.log(p1)


    // es6方式
    const p2 = {age,name}
    console.log(p2) //{age: 12, name: "Amy"} 
    /**
     *Object
     *   age: 12
     *   name: "Amy"
     * 
     */ 
</script>